<!DOCTYPE html>
<html lang="en">
  <head>
    <title>BufferType Enumeration Reference</title>
    <link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../../js/jquery.min.js" defer></script>
    <script src="../../js/jazzy.js" defer></script>
    
    <script src="../../js/lunr.min.js" defer></script>
    <script src="../../js/typeahead.jquery.js" defer></script>
    <script src="../../js/jazzy.search.js" defer></script>
  </head>
  <body>
    <a name="//apple_ref/swift/Enum/BufferType" class="dashAnchor"></a>
    <a title="BufferType Enumeration Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../../index.html">SwiftCoroutine 2.1.9 Docs</a> (88% documented)</p>
        <p class="header-right">
          <form role="search" action="../../search.json">
            <input type="text" placeholder="Search documentation" data-typeahead>
          </form>
        </p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../../index.html">SwiftCoroutine Reference</a>
        <img id="carat" src="../../img/carat.png" />
        BufferType Enumeration Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel.html">CoChannel</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel/BufferType.html">– BufferType</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel/Receiver.html">– Receiver</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoChannel/Sender.html">– Sender</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoFuture.html">CoFuture</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoPromise.html">CoPromise</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Classes/CoScope.html">CoScope</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Enums/CoChannelError.html">CoChannelError</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Enums/CoFutureError.html">CoFutureError</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Enums/CoroutineError.html">CoroutineError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Extensions/DispatchQueue.html">DispatchQueue</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Extensions/Publisher.html">Publisher</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Extensions/URLSession.html">URLSession</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Protocols/CoCancellable.html">CoCancellable</a>
              </li>
              <li class="nav-group-task">
                <a href="../../Protocols/CoroutineScheduler.html">CoroutineScheduler</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../../Structs/Coroutine.html">Coroutine</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>BufferType</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">BufferType</span> <span class="p">:</span> <span class="kt">Equatable</span></code></pre>

                </div>
              </div>
            <p><code><a href="../../Classes/CoChannel.html">CoChannel</a></code> buffer type.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC10BufferTypeO4noneyAEyx_GAGmlF"></a>
                    <a name="//apple_ref/swift/Element/none" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC10BufferTypeO4noneyAEyx_GAGmlF">none</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This channel does not have any buffer.</p>

<p>An element is transferred from the sender to the receiver only when send and receive invocations meet in time,
so <code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC9awaitSendyyxKF">awaitSend(_:)</a></code> suspends until invokes receive, and <code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC12awaitReceivexyKF">awaitReceive()</a></code> suspends until invokes send.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="k">case</span> <span class="k">none</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC10BufferTypeO8bufferedyAEyx_GSi_tcAGmlF"></a>
                    <a name="//apple_ref/swift/Element/buffered(capacity:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC10BufferTypeO8bufferedyAEyx_GSi_tcAGmlF">buffered(capacity:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This channel have a buffer with the specified capacity.</p>

<p><code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC9awaitSendyyxKF">awaitSend(_:)</a></code> suspends only when the buffer is full,
and <code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC12awaitReceivexyKF">awaitReceive()</a></code> suspends only when the buffer is empty.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="k">case</span> <span class="nf">buffered</span><span class="p">(</span><span class="nv">capacity</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC10BufferTypeO9unlimitedyAEyx_GAGmlF"></a>
                    <a name="//apple_ref/swift/Element/unlimited" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC10BufferTypeO9unlimitedyAEyx_GAGmlF">unlimited</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This channel has a buffer with unlimited capacity.</p>

<p><code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC9awaitSendyyxKF">awaitSend(_:)</a></code> to this channel never suspends, and offer always returns true.
<code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC12awaitReceivexyKF">awaitReceive()</a></code> suspends only when the buffer is empty.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="k">case</span> <span class="n">unlimited</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14SwiftCoroutine9CoChannelC10BufferTypeO9conflatedyAEyx_GAGmlF"></a>
                    <a name="//apple_ref/swift/Element/conflated" class="dashAnchor"></a>
                    <a class="token" href="#/s:14SwiftCoroutine9CoChannelC10BufferTypeO9conflatedyAEyx_GAGmlF">conflated</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>This channel buffers at most one element and offer invocations,
so that the receiver always gets the last element sent.</p>

<p>Only the last sent element is received, while previously sent elements are lost.
<code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC9awaitSendyyxKF">awaitSend(_:)</a></code> to this channel never suspends, and offer always returns true.
<code><a href="../../Classes/CoChannel.html#/s:14SwiftCoroutine9CoChannelC12awaitReceivexyKF">awaitReceive()</a></code> suspends only when the buffer is empty.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="k">case</span> <span class="n">conflated</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2020 <a class="link" href="https://github.com/belozierov/SwiftCoroutine" target="_blank" rel="external">Alex Belozierov</a>. All rights reserved. (Last updated: 2020-07-11)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
